home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / sbin_-_Static_Binary_Files / SETUP.TTY < prev    next >
Encoding:
Text File  |  1999-09-17  |  50.1 KB  |  1,577 lines

  1. #!/bin/sh
  2. #
  3. # Copyright 1993,1994,1995 Patrick Volkerding, Moorhead, Minnesota USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is 
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. #    notice, this list of conditions and the following disclaimer.
  11. #
  12. #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  13. #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
  14. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
  15. #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  16. #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  19. #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
  20. #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
  21. #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. #
  23. # As always, bug reports, suggestions, etc: volkerdi@mhd1.moorhead.msus.edu
  24. # or bf703@cleveland.freenet.edu, or (if you absolutely must) (218) 233-4349.
  25. # T_PX = target prefix, T_MT = target mounted
  26. print_list() {
  27. cat << EOF
  28.       A   - Base Linux system
  29.       AP  - Various applications that do not need X
  30.       D   - Program Development (C, C++, Kernel source, Lisp, Perl, etc.)
  31.       E   - GNU Emacs
  32.       F   - FAQ lists
  33.       K   - Linux kernel source
  34.       N   - Networking (TCP/IP, UUCP, Mail)
  35.       Q   - Extra kernels with special drivers (needed for non-SCSI CD)
  36.       T   - TeX
  37.       TCL - Tcl/Tk/TclX, Tcl language, and Tk toolkit for developing X apps
  38.       X   - XFree86 Base X Window System
  39.       XAP - X Window Applications
  40.       XD  - XFree86 X11 server development system
  41.       XV  - XView (OpenLook [virtual] Window Manager, apps)
  42.       Y   - Games (that do not require X)
  43. EOF
  44. }
  45. # 'probe()' borrowed from LILO QuickInst.
  46. probe()
  47. {
  48.  [ ! -z "`dd if=$1 bs=1 count=1 2>/dev/null | tr '\0' x`" ]
  49.  return
  50. }
  51. T_MT="n"
  52. ADDSOFT="n"
  53. if [ -d /usr/man/man1 ]; then # detect a *real* Linux system (are man pages there?)
  54.  T_PX="/"
  55.  ADDSOFT="a"
  56.  T_MT="y"
  57. else
  58.  T_PX="/mnt"
  59. fi
  60. if [ "$1" = "-target_mounted" -o "$2" = "-target_mounted" ]; then # the target partitions have been manually mounted
  61.  T_MT="y"
  62. fi
  63. if [ "y" = "$T_MT" ]; then # target partitions have been manually mounted
  64.  if mount | fgrep /var/adm/mount 1> /dev/null 2> /dev/null ; then
  65.   umount /var/adm/mount
  66.  fi
  67.  if [ "$T_PX" = "/mnt" ]; then
  68.   cat << EOF
  69. You have used the '-target_mounted' flag. In order to proceed, you must
  70. have formatted all of your Linux partitions with mke2fs or mkxfs and
  71. mounted all of them beneath /mnt. You should also use mkswap on your swap
  72. swap partitions and use 'swapon' to activate them.
  73.  
  74. When run in this mode, 'setup' does not automatically create an /etc/fstab
  75. for you. When the installation completes, you must create an /etc/fstab
  76. before you reboot. (if you're not just adding software, in which case you
  77. already have an /etc/fstab)
  78.  
  79. Since your real /etc directory is mounted under /mnt, you'll want to
  80. say 'vi /mnt/etc/fstab' and not 'vi /etc/fstab', of course.
  81. EOF
  82.  fi
  83. else
  84.  if [ -d /mnt/etc -o -d /mnt/lost+found ]; then # nothing should be on /mnt here!
  85.   umount -a 1> /dev/null 2> /dev/null
  86.   mount /proc /proc -t proc
  87.  fi
  88. fi
  89. rm -f /var/adm/mount 2> /dev/null
  90. rmdir /var/adm/mount 2> /dev/null
  91. mkdir /var/adm/mount 2> /dev/null
  92. rm -f /fsta*
  93. SWAP_IN_USE="false"
  94. REFORM="a"
  95.  
  96. # Make sure there's a proper temp directory:
  97. TMP=$T_PX/var/log/setup/tmp
  98. # If the $TMP directory doesn't exist, create it:
  99. if [ ! -d $TMP ]; then
  100.   rm -rf $TMP # make sure it's not a symlink or something stupid
  101.   mkdir $TMP
  102.   chmod 700 $TMP # no need to leave it open
  103. fi
  104.  
  105. echo
  106. echo "Welcome to Slackware Linux Setup (v. 3.5.0-text)"
  107. while [ 0 ]; do 
  108.  if [ "$T_PX" = "/" ]; then # skip keyboard config if on HD.
  109.   echo
  110.   break;
  111.  fi
  112.  while [ 0 ]; do
  113.   cat << EOF
  114.  
  115. Linux supports many different keyboard configurations. If you are not
  116. using a US keyboard, you will probably want to remap your keyboard.
  117.  
  118. Would you like to remap your keyboard?
  119.  
  120. 1 - yes
  121. 2 - no
  122.  
  123. EOF
  124.   echo -n "Your choice (1/2)? "
  125.   read REPLY;
  126.   if [ "$REPLY" = "1" -o "$REPLY" = "2" ]; then
  127.    break;
  128.   fi
  129.  done
  130.  if [ "$REPLY" = "1" ]; then
  131.   echo
  132.   echo "Please select one of the following keyboard maps:"
  133.   echo
  134.   COUNT="1"
  135.   for mapname in azerty.map be-latin1.map cf.map de-latin1-nodeadkeys.map \
  136. de-latin1.map de.map defkeymap.map defkeymap_V1.0.map dk-latin1.map dk.map \
  137. dvorak.map emacs.map emacs2.map es.map fi-latin1.map fi.map fr-latin1.map \
  138. fr.map gr-pc.map gr.map hebrew.map it-ibm.map it.map no-latin1.map no.map \
  139. pl.map ru.map ru1.map ru2.map sf-latin1.map sf.map sg-latin1-lk450.map \
  140. sg-latin1.map sg.map slovene.map uk.map us.map ; do
  141.    THISMAP="$COUNT -- `basename $mapname`                              "
  142.    THISMAP="`echo "$THISMAP" | cut -b1-38`"
  143.    FUN_RESULT="`expr $COUNT % 2`"
  144.    if [ "$FUN_RESULT" = "1" ]; then
  145.     echo -n "$THISMAP"
  146.    else
  147.     echo "$THISMAP"
  148.    fi
  149.    COUNT=`expr $COUNT + 1`
  150.   done
  151.   echo
  152.   echo
  153.   echo -n "Which keyboard map would you like (1 - `expr $COUNT - 1`)? "
  154.   read MAPNUM;
  155.   COUNT="1"
  156.   MAPNAME="garbage" # and then we look for the real one
  157.   for mapname in azerty.map be-latin1.map cf.map de-latin1-nodeadkeys.map \
  158. de-latin1.map de.map defkeymap.map defkeymap_V1.0.map dk-latin1.map dk.map \
  159. dvorak.map emacs.map emacs2.map es.map fi-latin1.map fi.map fr-latin1.map \
  160. fr.map gr-pc.map gr.map hebrew.map it-ibm.map it.map no-latin1.map no.map \
  161. pl.map ru.map ru1.map ru2.map sf-latin1.map sf.map sg-latin1-lk450.map \
  162. sg-latin1.map sg.map slovene.map uk.map us.map ; do
  163.    if [ "$COUNT" = "$MAPNUM" ]; then
  164.     MAPNAME=`basename $mapname`
  165.    fi
  166.    COUNT=`expr $COUNT + 1`
  167.   done
  168.   echo
  169.   echo "Installing keyboard map '$MAPNAME'..."
  170.   echo
  171.   loadgzkeys $MAPNAME
  172.   cat << EOF
  173. OK, the new map is now installed. You may now test it by typing
  174. anything you want. To quit testing the keyboard, enter [1] on a
  175. line by itself to accept the map and go on, or [2] on a line by
  176. itself to reject the current keyboard map and select a new one.
  177.  
  178. EOF
  179.   while [ 0 ]; do
  180.    echo -n "test keyboard, or [1], or [2] => "
  181.    read REPLY;
  182.    if [ "$REPLY" = "1" -o "$REPLY" = "2" ]; then
  183.    break;
  184.    fi
  185.   done
  186.   if [ "$REPLY" = "1" ]; then
  187.    REMAPPING_DONE="true"
  188.    break;
  189.   else
  190.    continue;
  191.   fi
  192.  else
  193.   # No remapping done
  194.   break;
  195.  fi
  196. done
  197. if [ "y" = "$T_MT" -a "$T_PX" = "/mnt" ]; then
  198.  while [ 0 ]; do
  199.   echo
  200.   echo "Are you installing Linux from scratch, or adding software to an existing"
  201.   echo "system? "
  202.   echo
  203.   echo -n "[I]nstall from scratch, or [a]dd? "
  204.   read ADDSOFT;
  205.   if [ "$ADDSOFT" = "a" -o "$ADDSOFT" = "i" ]; then
  206.    break;
  207.   fi
  208.  done
  209. fi
  210. PARTLIST="`fdisk -l | fgrep "Linux native"`"
  211. if [ "y" = "$T_MT" ]; then
  212.  PARTLIST="BOGUS" # A wonderful example of unstructured programming
  213. fi
  214. if [ ! "$PARTLIST" = "" ]; then
  215.  if [ ! "$PARTLIST" = "BOGUS" ]; then
  216.   SWAPLIST="`fdisk -l | fgrep "Linux swap"`" 
  217.   if [ "$SWAPLIST" = "" ]; then
  218.    echo 
  219.    echo "You have not created a swap partition with Linux fdisk."
  220.    echo -n "Do you want to continue without a swapfile ([y]es, [n]o)? "
  221.    read REPLY;
  222.    if [ "$REPLY" = "n" -o "$REPLY" = "N" ]; then
  223.     echo 
  224.     echo "Create a swapfile with Linux fdisk, and then run setup again."
  225.     echo 
  226.     exit;
  227.    fi
  228.   else
  229.    echo  
  230.    if [ "`echo "$SWAPLIST" | sed -n '2 p'`" = "" ]; then
  231.     echo "Slackware Setup has detected a swap partition:"
  232.     echo "`echo "$SWAPLIST" | sed -n '1 p'`"
  233.     echo 
  234.     echo -n "Do you wish to install this partition as your swapspace ([y]es, [n]o)? "
  235.    else
  236.     echo "Slackware Setup has detected the following swap partitions:"
  237.     echo "$SWAPLIST" 
  238.     echo
  239.     echo -n "Do you wish to install these as your swap partitions ([y]es, [n]o)? "
  240.    fi
  241.    read REPLY;
  242.    if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
  243.     cat << EOF
  244.  
  245. IMPORTANT NOTE: If you have already made any of your swap partitions
  246. active (using the swapon command), then you should not allow setup to
  247. use mkswap on your swap partitions, because it may corrupt memory pages
  248. that are currently swapped out. Instead, you will have to make sure that
  249. your swap partitions have been prepared (with mkswap) before they will
  250. work. You might want to do this to any inactive swap partitions before
  251. you reboot.
  252.  
  253. EOF
  254.     echo -n "Do you want setup to use mkswap on your swap partitions ([y]es, [n]o)? "  
  255.     read USE_SWAP;
  256.     echo
  257.     rm -f /fstab.swap
  258.     rm -f $T_PX/fstab
  259.     CURRENT_SWAP="1" 
  260.     while [ ! "`echo "$SWAPLIST" | sed -n "$CURRENT_SWAP p"`" = "" ]; do 
  261.      echo "Setting up swapspace..."
  262.      SWAP_SIZE=`fdisk -l | fgrep "Linux swap" | sed -n "$CURRENT_SWAP p"`
  263.      SWAP_PART=`echo $SWAP_SIZE | cut -f 1 -d ' '`
  264.      SWAP_SIZE=`echo $SWAP_SIZE | cut -f 4 -d ' '`
  265.      if [ "$USE_SWAP" = "Y" -o "$USE_SWAP" = "y" ]; then 
  266.       mkswap $SWAP_PART $SWAP_SIZE
  267.      fi
  268.      swapon $SWAP_PART
  269.      echo "Adding this line to /etc/fstab:"
  270.      SWAP_IN_USE="`echo "$SWAP_PART       swap        swap        defaults   1   1"`"
  271.      echo "$SWAP_IN_USE"
  272.      echo "$SWAP_IN_USE" >> /fstab.swap
  273.      echo "Swapspace configured."
  274.      CURRENT_SWAP="`expr $CURRENT_SWAP + 1`"
  275.     done
  276.    fi
  277.   fi  
  278.   echo 
  279.   if [ ! "`echo "$PARTLIST" | sed -n '2 p'`" = "" ]; then # more than one:
  280.    echo "The following partitions on your machine are available for Linux:"
  281.    ONLY_ONE="false"
  282.   else
  283.    echo "The following partition is available for Linux:"
  284.    ONLY_ONE="true"
  285.   fi
  286.   echo 
  287.   echo "   Device Boot   Start      End   Blocks   Id  System"
  288.   fdisk -l | fgrep "Linux native"
  289.   while [ 0 ]; do 
  290.    if [ "$ONLY_ONE" = "false" ]; then
  291.     echo
  292.     echo -n "Which device would you like to use for your root Linux partition? "
  293.     read ROOT_DEVICE;
  294.    else
  295.     ROOT_DEVICE=`echo $PARTLIST`
  296.     ROOT_DEVICE=`echo $ROOT_DEVICE | cut -f 1 -d ' '`
  297.    fi
  298.    echo 
  299.    if [ ! -b $ROOT_DEVICE ]; then
  300.     echo "Invalid device. Try again. Use a format such as:"
  301.     echo "/dev/hda3 or whatever the device name is."
  302.     continue;
  303.    fi
  304.    if fdisk -l | fgrep "Linux native" | fgrep $ROOT_DEVICE 1> /dev/null 2> /dev/null ; then
  305.     ROOT_SIZE=`fdisk -l | fgrep "$ROOT_DEVICE"`
  306.     ROOT_SIZE=`echo $ROOT_SIZE | cut -f 4 -d ' '`
  307.     cat << EOF
  308. If this is the root partition of an existing Linux system, you
  309. may add more software to the existing system, or you may
  310. reformat the partition and install from scratch.
  311.  
  312. EOF
  313.     echo -n "Would you like to [a]dd more software, or [i]nstall from scratch? "
  314.     read ADDSOFT;
  315.     # I think the xiafs filesystem is pretty much dead at this point, so
  316.     # that choice is going away...
  317.     ROOT_SYS_TYPE="ext2"
  318.     while [ 0 ]; do
  319.      if [ "$ADDSOFT" = "a" ]; then
  320.       echo
  321.       echo "Software will be added to your system without reformatting your"
  322.       echo "partitions. "
  323.       echo
  324.       echo "Mounting your root partition..."
  325.       mount -t $ROOT_SYS_TYPE $ROOT_DEVICE /mnt
  326.       if [ ! -r $T_PX/etc/fstab ]; then
  327.        echo
  328.        echo "Either you have specified the wrong filesystem type, or there"
  329.        echo "is no Linux system currently installed on the partition."
  330.        echo  
  331.        echo "Sorry, but you'll have to try again." 
  332.        exit;
  333.       fi
  334.       echo "Scanning your /etc/fstab..."
  335.       echo
  336.       index="0"
  337.       while [ 0 ]; do
  338.               index="`expr $index + 1`"
  339.        THISLINE="`cat $T_PX/etc/fstab | tr "[\011]" "[\040]" | sed -n "$index p"`"
  340.               BLANKCHECK="`echo $THISLINE | sed 's/ //g'`"
  341.               if [ "$BLANKCHECK" = "" ]; then
  342.                       break;
  343.               fi
  344.               if echo "$THISLINE" | fgrep ext2 1> /dev/null 2> /dev/null ; then
  345.                       ADD_TYPE="ext2"
  346.        elif echo "$THISLINE" | fgrep xiafs 1> /dev/null 2> /dev/null ; then
  347.         ADD_TYPE="xiafs"
  348.               else
  349.                       continue;
  350.               fi
  351.        NEWPART=`echo $THISLINE | cut -f 1 -d ' '`
  352.        THISLINE="`echo "$THISLINE" | cut -b11-`"
  353.        while [ 0 ]; do
  354.         FIRST="`echo "$THISLINE" | cut -b1`"
  355.         if [ "$FIRST" = "/" ]; then
  356.          break;
  357.         fi
  358.         THISLINE="`echo "$THISLINE" | cut -b2-`"
  359.        done
  360.        SECOND="`echo "$THISLINE" | cut -b2`" 
  361.        if [ "$SECOND" = " " ]; then
  362.         # We don't want to remount the / partition
  363.         continue;
  364.        fi
  365.        end_of_line="1"
  366.        while [ 0 ]; do
  367.         end_of_line="`expr $end_of_line + 1`"
  368.         if [ "`echo "$THISLINE" | cut -b$end_of_line`" = " " -o "`echo "$THISLINE" | cut -b$end_of_line`" = "" -o "`echo "$THISLINE" | cut -b$end_of_line`" = "fucking tab character" ]; then
  369.          # Found it!
  370.                 end_of_line="`expr $end_of_line - 1`"
  371.          break;
  372.         fi
  373.        done
  374.        MNTDIR="`echo "$THISLINE" | cut -b1-$end_of_line`"
  375.        echo "Mounting $NEWPART under $T_PX$MNTDIR as type $ADD_TYPE..."
  376.        mount -t $ADD_TYPE $NEWPART $T_PX$MNTDIR
  377.       done
  378.       break;
  379.      else
  380.       cat << EOF
  381.  
  382. Since you've chosen to install Linux from scratch, we want to be
  383. sure you know how to proceed, and we also want to give you one last
  384. chance to change your mind. When using this option, you must install
  385. to a blank partition. If you have not already formatted it manually
  386. then you must format it when prompted.
  387.  
  388. Enter [i] again to install from scratch, or [a] to add
  389. software to your existing system.
  390.  
  391. EOF
  392.       echo -n "Install fresh, or add software to your current system? ([i]nstall, [a]dd)? "
  393.       read REFORM;
  394.       if [ "$REFORM" = "i" ]; then
  395.        echo
  396.        echo "If this partition has not been formatted, you should format it."
  397.        echo
  398.        break;
  399.       else
  400.        ADDSOFT="a"
  401.       fi
  402.      fi           
  403.     done
  404.     if [ ! "$ADDSOFT" = "a" ]; then
  405.      echo -n "Would you like to format this partition ([y]es, [n]o, [c]heck sectors too)? "
  406.      read DOFORMAT;
  407.      echo
  408.      if [ "$DOFORMAT" = "Y" -o "$DOFORMAT" = "y" -o "$DOFORMAT" = "c" ]; then
  409.       echo "Attempting to unmount $ROOT_DEVICE..."
  410.       umount $ROOT_DEVICE 
  411.       cat << EOF
  412.  
  413. Ext2fs defaults to one inode per 4096 bytes of drive space. If you're going to
  414. have many small files on your drive, you may need more inodes (one is used for
  415. each file entry). You can change the density to one inode per 2048 bytes, or
  416. even per 1024 bytes.
  417.  
  418. EOF
  419.       echo "Enter '2048' or '1024', or just hit enter to accept the"
  420.       echo -n "default of 4096: "
  421.       read DENSITY;
  422.       echo
  423.       if [ ! "$DENSITY" = "2048" -a ! "$DENSITY" = "1024" ]; then
  424.        DENSITY=4096
  425.       fi
  426.       echo "Formatting $ROOT_DEVICE ($ROOT_SIZE blocks) as type $ROOT_SYS_TYPE..."
  427.       if [ "$DOFORMAT" = "c" ]; then
  428.         mke2fs -c -i $DENSITY $ROOT_DEVICE $ROOT_SIZE
  429.       else
  430.         mke2fs -i $DENSITY $ROOT_DEVICE $ROOT_SIZE
  431.       fi
  432.       echo "Done formatting device $ROOT_DEVICE."
  433.      fi
  434.      echo "Mounting your new root partition:"
  435.      mount -t $ROOT_SYS_TYPE $ROOT_DEVICE $T_PX 1> /dev/null 2> /dev/null
  436.      if [ ! -d $T_PX/tmp ]; then
  437.       mkdir $T_PX/tmp
  438.       chmod 1777 $T_PX/tmp
  439.      fi
  440.      echo "Root partition mounted."
  441.      if [ ! "$SWAP_IN_USE" = "false" ]; then
  442.       cat /fstab.swap >> $T_PX/fstab
  443.      fi
  444.      echo "$ROOT_DEVICE       /        $ROOT_SYS_TYPE        defaults   1   1" >> $T_PX/fstab 
  445.      break;
  446.     fi
  447.    else # device not tagged Linux native
  448.     echo "The partition you have selected is not tagged as Linux"
  449.     echo "native. Either select a new partition, or tag the selected"
  450.     echo "one with Linux fdisk." 
  451.     continue;
  452.    fi
  453.    break;
  454.   done # mounting the target root partition
  455.   if [ ! "$ADDSOFT" = "a" ]; then
  456.    # Now, if the user wants to mount some other partitions for /usr or
  457.    # /usr/X11 or whatever (/tmp, you name it), Here's where we do that
  458.    echo 
  459.    if [ ! "`echo "$PARTLIST" | sed -n '2 p'`" = "" ]; then
  460.     cat << EOF
  461. You seem to have more than one partition tagged as Linux native.
  462. You may use these to distribute your Linux system across more than
  463. one partition. Currently, you have $ROOT_DEVICE mounted as your /
  464. partition. You might want to mount large directories such as /usr
  465. or /usr/X11R6 on seperate partitions. You should not try to mount
  466. /etc or /bin on their own partitions since they contain utilities
  467. needed to bring the system up and mount partitions.
  468.  
  469. Would you like to use some of the other Linux partitions
  470. EOF
  471.     echo -n "to mount some of your directories ([y]es, [n]o)? "
  472.     read MOUNTMORE;
  473.     if [ "$MOUNTMORE" = "y" -o "$MOUNTMORE" = "Y" ]; then
  474.      while [ 0 ]; do
  475.       echo 
  476.       echo "These are your Linux partitions:"
  477.       echo "$PARTLIST" 
  478.       echo 
  479.       echo "These partitions are already in use:"
  480.       mount | fgrep mnt
  481.       echo 
  482.       echo "Please enter the partition you would like to use, or"
  483.       echo -n "type <q> to quit adding new partitions: " 
  484.       read NEXT_PARTITION;
  485.       if [ "$NEXT_PARTITION" = "q" ]; then
  486.        break;
  487.       fi
  488.       if [ ! -b $NEXT_PARTITION ]; then
  489.        echo
  490.        echo "Invalid device. Try again. Use a format such as:"
  491.        echo "/dev/hda3 or whatever the device name is."
  492.        continue;
  493.       else
  494.        if fdisk -l | fgrep "Linux native" | fgrep $NEXT_PARTITION 1> /dev/null 2> /dev/null ; then
  495.         NEXT_SIZE=`fdisk -l | fgrep "$NEXT_PARTITION"`
  496.         NEXT_SIZE=`echo $NEXT_SIZE | cut -f 4 -d ' '`
  497.         NEXT_SYS_TYPE="ext2"
  498.         echo
  499.         echo -n "Would you like to format this partition ([y]es, [n]o, [c]heck sectors too)? "
  500.         read DOFORMAT;
  501.         if [ "$DOFORMAT" = "Y" -o "$DOFORMAT" = "y" -o "$DOFORMAT" = "c" ]; then
  502.          if [ "$NEXT_SYS_TYPE" = "ext2" ]; then
  503.           cat << EOF
  504.  
  505. Ext2fs defaults to one inode per 4096 bytes of drive space. If you're going to
  506. have many small files on your drive, you may need more inodes (one is used for
  507. each file entry). You can change the density to one inode per 2048 bytes, or
  508. even per 1024 bytes.
  509.  
  510. EOF
  511.           echo "Enter '2048' or '1024', or just hit enter to accept the"
  512.           echo -n "default of 4096: "
  513.           read DENSITY;
  514.           echo
  515.           if [ ! "$DENSITY" = "2048" -a ! "$DENSITY" = "1024" ]; then
  516.            DENSITY=4096
  517.           fi
  518.          fi
  519.          echo "Formatting $NEXT_PARTITION ($NEXT_SIZE blocks) as Linux $NEXT_SYS_TYPE..."
  520.          if [ "$NEXT_SYS_TYPE" = "ext2" ]; then
  521.           if [ "$DOFORMAT" = "c" ]; then
  522.            mke2fs -c -i $DENSITY $NEXT_PARTITION $NEXT_SIZE
  523.           else
  524.            mke2fs -i $DENSITY $NEXT_PARTITION $NEXT_SIZE
  525.           fi
  526.          else
  527.           if [ "$DOFORMAT" = "c" ]; then
  528.            mkxfs -c $NEXT_PARTITION $NEXT_SIZE
  529.           else
  530.            mkxfs $NEXT_PARTITION $NEXT_SIZE
  531.           fi
  532.          fi
  533.          echo "Done formatting device $NEXT_PARTITION."
  534.         fi
  535.         echo 
  536.         echo "Now this new partition must be mounted somewhere in your new"
  537.         echo "directory tree. For example, if you want to put it under /usr/X11R6,"
  538.         echo "then respond: /usr/X11R6"
  539.         echo 
  540.         echo -n "Where would you like to mount $NEXT_PARTITION? "
  541.         read NEW_DIRECTORY;
  542.         echo "Mounting device $NEXT_PARTITION under $NEW_DIRECTORY on your root device:"
  543.         mkdir -p /mnt$NEW_DIRECTORY
  544.         chmod 755 /mnt$NEW_DIRECTORY
  545.         mount -t $NEXT_SYS_TYPE $NEXT_PARTITION /mnt$NEW_DIRECTORY 1> /dev/null 2> /dev/null
  546.         echo "Partition $NEXT_PARTITION mounted."
  547.         echo "$NEXT_PARTITION        $NEW_DIRECTORY        $NEXT_SYS_TYPE        defaults   1   1" >> /mnt/fstab 
  548.         echo 
  549.         echo -n "Would you like to mount some more additional partitions ([y]es, [n]o)? "
  550.         read REPLY;
  551.         if [ "$REPLY" = "n" -o "$REPLY" = "N" ]; then
  552.          break;
  553.         fi
  554.        else # device not tagged Linux native
  555.         echo "The partition you have selected is not tagged as Linux"
  556.         echo "native. Either select a new partition, or tag the selected"
  557.         echo "one with Linux fdisk." 
  558.         continue;
  559.        fi
  560.       fi
  561.      done # mounting additional partitions
  562.      echo
  563.     fi
  564.    else
  565.     echo "Installing all software on $ROOT_DEVICE."
  566.     echo 
  567.    fi # end of target partition setup
  568.    # Add DOS and OS/2 partitions:
  569.    DOSLIST="`fdisk -l | fgrep "DOS
  570. FAT16
  571. FAT32
  572. HPFS"`"
  573.    if [ ! "$DOSLIST" = "" ]; then # there are DOS or OS/2 partitions:
  574.     cat << EOF
  575. DOS AND OS/2 PARTITION SETUP
  576.  
  577. The following DOS FAT or OS/2 HPFS partitions were found:
  578.  
  579. $DOSLIST
  580.  
  581. Would you like to set up some of these partitions to be visible
  582. EOF
  583.     echo -n "from Linux ([y]es, [n]o)? "
  584.     read ADDDOS;
  585.     if [ "$ADDDOS" = "y" -o "$ADDDOS" = "Y" ]; then
  586.      while [ 0 ]; do
  587.       USED_DOS_PARTITIONS="`cat /mnt/fstab | fgrep vfat`"
  588.       USED_HPFS_PARTITIONS="`cat /mnt/fstab | fgrep hpfs`"
  589.       if [ ! "$USED_HPFS_PARTITIONS" = "" ]; then
  590.        USED_DOS_PARTITIONS="`echo -e "$USED_DOS_PARTITIONS\n$USED_HPFS_PARTITIONS"`"
  591.       fi
  592.       if [ ! "$USED_DOS_PARTITIONS" = "" ]; then
  593.        echo
  594.        echo "These DOS or OS/2 partitions have already been added"
  595.        echo "to your /etc/fstab:"
  596.        echo "$USED_DOS_PARTITIONS"
  597.       fi
  598.       echo 
  599.       echo "These DOS or OS/2 partitions are available to mount:"
  600.       echo "$DOSLIST" 
  601.       echo 
  602.       echo "Please enter the partition you would like to access from Linux, or"
  603.       echo -n "type <q> to quit adding new partitions: " 
  604.       read NEXT_PARTITION;
  605.       echo 
  606.       if [ "$NEXT_PARTITION" = "q" ]; then
  607.        break;
  608.       fi
  609.       if [ ! -b $NEXT_PARTITION ]; then
  610.        echo "Invalid device. Try again. Use a format such as:"
  611.        echo "/dev/hda3 or whatever the device name is."
  612.        continue;
  613.       else
  614.        if echo "$DOSLIST" | fgrep $NEXT_PARTITION 1> /dev/null 2> /dev/null ; then
  615.         # Here we should test to be sure the partition has not been used
  616.         if fgrep $NEXT_PARTITION /mnt/fstab 1> /dev/null 2> /dev/null ; then
  617.          # We have already added this partition.
  618.          echo "Sorry, you have already added the partition $NEXT_DEVICE to the"
  619.          echo "list of devices that are mounted at boot time. Either choose a"
  620.          echo "partition you have not yet used, or [q]uit to go on."
  621.          continue;
  622.         fi
  623.         echo "Now this new partition must be mounted somewhere in your directory"
  624.         echo "tree. Please enter the directory under which you would like to put"
  625.         echo "it. for instance, you might want to reply /dosc, /dosd, or something"
  626.         echo "like that."
  627.         echo
  628.         echo -n "Where would you like to mount $NEXT_PARTITION? "
  629.         read NEW_DIR;
  630.     if [ ! "`echo $NEW_DIR | cut -b1`" = "/" ]; then
  631.          NEW_DIR="/$NEW_DIR"
  632.         fi
  633.         echo 
  634.         echo "Creating mount point directory..."
  635.         mkdir -p /mnt$NEW_DIR
  636.         echo "Setting directory permissions..."
  637.         chmod 755 /mnt$NEW_DIR
  638.         if fdisk -l | fgrep "HPFS" | fgrep $NEXT_PARTITION 1> /dev/null 2> /dev/null ; then
  639.          echo "Adding HPFS partition (read only) to /etc/fstab..."
  640.          echo "$NEXT_PARTITION        $NEW_DIR        hpfs         ro" >> /mnt/fstab 
  641.         else
  642.          echo "Adding DOS partition to /etc/fstab..."
  643.          echo "$NEXT_PARTITION        $NEW_DIR        vfat         defaults   1   1" >> /mnt/fstab 
  644.         fi
  645.         echo "Done adding partition $NEXT_PARTITION."
  646.        else # device not tagged as DOS
  647.         echo "The partition you have selected is not tagged as a DOS or OS/2"
  648.         echo "partition, please try again."
  649.         continue;
  650.        fi
  651.       fi
  652.      done # mounting DOS/HPFS partitions
  653.     fi
  654.    fi
  655.   fi # ! just adding stuff
  656.  fi # PARTLIST != BOGUS (for T_MT)
  657.  DISTRIBUTION_SOURCE="/var/adm/mount"
  658.  SOURCE_DEVICE="/dev/fd0"
  659.  if [ "$T_PX" = "/" ]; then
  660.   echo -n "Would you like to install more software ([y]es, [n]o)? "
  661.   read INSFT;
  662.  fi
  663.  if [ "$INSFT" = "y" -o ! "$T_PX" = "/" ]; then
  664.   cat << EOF
  665.  
  666. SOURCE MEDIA SELECTION
  667.  
  668. 1 -- Install from a hard drive partition.
  669. 2 -- Install from floppy disks.
  670. 3 -- Install via NFS.
  671. 4 -- Install from a pre-mounted directory.
  672. 5 -- Install from CD-ROM.
  673.  
  674. EOF
  675.   echo -n "From which source will you be installing Linux (1/2/3/4/5)? "
  676.   read SOURCE_MEDIA;
  677.   echo 
  678.   if [ "$SOURCE_MEDIA" = "1" ]; then
  679.    cat << EOF
  680. INSTALLING FROM HARD DISK
  681.  
  682. In order to install directly from the hard disk you must have a partition with
  683. a directory containing the Slackware distribution such that each disk other than
  684. the boot disk is contained in a subdirectory. For example, if the distribution 
  685. is in /stuff/slack, then you have to have directories named /stuff/slack/a1, 
  686. /stuff/slack/a2, and so on each containing the files that would be on that disk.
  687. You may install from DOS, HPFS, or Linux partitions.
  688.  
  689. EOF
  690.    while [ 0 ]; do
  691.     echo "Please enter the partition where the Slackware sources can be"
  692.     echo -n "found, or [p] to see a partition list: "
  693.     read SLACK_DEVICE;
  694.     echo 
  695.     if [ "$SLACK_DEVICE" = "p" -o "$SLACK_DEVICE" = "P" ]; then
  696.      echo "Here are your partitions:"
  697.      echo
  698.      fdisk -l | fgrep "/dev"
  699.      echo
  700.      continue;
  701.     fi
  702.     break;
  703.    done
  704.    cat << EOF
  705. Now we need to know what directory on this partition the Slackware sources
  706. can be found in. In the example above, this would be: /stuff/slack
  707.  
  708. NOTE: You must give the directory name relative to the top of the partition.
  709. So, for example, if you're going to mount this partition under /usr, don't
  710. include the '/usr' at the beginning of the pathname.
  711.  
  712. EOF
  713.    echo -n "What directory are the Slackware sources in? "
  714.    read SLACK_SOURCE_LOCATION;
  715.    echo
  716.    if mount | fgrep $SLACK_DEVICE 1> /dev/null 2> /dev/null ; then
  717.     # This partition is already mounted, so we will have to
  718.     # tweak things funny.
  719.     rm -f /var/adm/mount 2> /dev/null
  720.     rmdir /var/adm/mount 2> /dev/null
  721.     PREFIX="`mount | fgrep $SLACK_DEVICE`"
  722.     PREFIX="`echo "$PREFIX" | cut -b14-`"
  723.     end_of_line="1"
  724.     while [ 0 ]; do
  725.      end_of_line="`expr $end_of_line + 1`"
  726.      if [ "`echo "$PREFIX" | cut -b$end_of_line`" = " " ]; then  # Found it!
  727.       end_of_line="`expr $end_of_line - 1`"
  728.       break;
  729.      fi
  730.     done
  731.     PREFIX="`echo "$PREFIX" | cut -b1-$end_of_line`"
  732.     ln -sf $PREFIX /var/adm/mount 
  733.    else
  734.     while [ 0 ]; do
  735.      cat << EOF
  736. What type of filesystem does your Slackware source partition contain?
  737.  
  738. 1 - FAT (MS-DOS, DR-DOS, OS/2)
  739. 2 - Linux Second Extended Filesystem
  740. 3 - Linux Xiafs
  741. 4 - Linux MINIX
  742. 5 - OS/2 HPFS
  743.  
  744. EOF
  745.      echo -n "Filesystem (1,2,3,4,5)? "
  746.      read FILESYS;
  747.      if [ "$FILESYS" = "1" ]; then 
  748.       SLACK_FS_TYPE="vfat"
  749.       break;
  750.      elif [ "$FILESYS" = "2" ]; then 
  751.       SLACK_FS_TYPE="ext2"
  752.       break;
  753.      elif [ "$FILESYS" = "3" ]; then 
  754.       SLACK_FS_TYPE="xiafs"
  755.       break;
  756.      elif [ "$FILESYS" = "4" ]; then 
  757.       SLACK_FS_TYPE="minix"
  758.       break;
  759.      elif [ "$FILESYS" = "5" ]; then 
  760.       SLACK_FS_TYPE="hpfs"
  761.       break;
  762.      fi
  763.     done
  764.     if [ "$FILESYS" = "5" ]; then
  765.      mount -o ro -t $SLACK_FS_TYPE $SLACK_DEVICE /var/adm/mount
  766.     else
  767.      mount -t $SLACK_FS_TYPE $SLACK_DEVICE /var/adm/mount
  768.     fi
  769.     if [ ! $? = 0 ]; then # there was a mount error
  770.      cat << EOF
  771.  
  772. There was a problem mounting your partition. Would you like to:
  773.  
  774. 1 -- Abort 'setup'.
  775. 2 -- Ignore the error and continue.
  776.  
  777. EOF
  778.      echo -n "Which (1/2)? "
  779.      read DOWHAT;
  780.      if [ $DOWHAT = 1 ]; then
  781.       echo
  782.       echo "Aborting..."
  783.       exit;
  784.      fi
  785.      echo
  786.     fi # mount error
  787.    fi
  788.    echo 
  789.    if [ -d /var/adm/mount/$SLACK_SOURCE_LOCATION ]; then
  790.     DISTRIBUTION_SOURCE=/var/adm/mount/$SLACK_SOURCE_LOCATION
  791.    else
  792.     cat << EOF
  793.  
  794. Sorry, but the directory $SLACK_SOURCE_LOCATION does not exist
  795. on partition $SLACK_DEVICE.
  796.  
  797. Aborting installation...
  798.  
  799. EOF
  800.     exit
  801.    fi
  802.    SOURCE_MOUNTED="-source_mounted"
  803.   elif [ "$SOURCE_MEDIA" = "4" ]; then
  804.    cat << EOF
  805.  
  806. OK, we will install from a directory that is currently mounted. This can be
  807. mounted normally or through NFS. You need to specify the name of the directory
  808. that contains the subdirectories for each source disk.
  809.  
  810. EOF
  811.    echo -n "Which directory would you like to install from? "
  812.    read SOURCEDIR;
  813.    rm -f /var/adm/mount 2> /dev/null
  814.    rmdir /var/adm/mount 2> /dev/null
  815.    ln -sf $SOURCEDIR /var/adm/mount
  816.    if [ -d $SOURCEDIR ]; then
  817.     DISTRIBUTION_SOURCE=/var/adm/mount
  818.    else
  819.     cat << EOF
  820.  
  821. Sorry - the directory you specified is not valid. Please check the directory
  822. and try again.
  823.  
  824. Aborting installation...
  825.  
  826. EOF
  827.     exit 1;
  828.    fi
  829.    SOURCE_MOUNTED="-source_mounted"
  830.   elif [ "$SOURCE_MEDIA" = "2" ]; then
  831.    cat << EOF
  832.  
  833. The base Slackware series (A) can be installed from 1.2M or 1.44M media. 
  834. Most of the other disks will not fit on 1.2M media, but can be downloaded
  835. to your hard drive and installed from there later.
  836.  
  837. 1 - /dev/fd0u1440 (1.44M drive a:)
  838. 2 - /dev/fd1u1440 (1.44M drive b:)
  839. 3 - /dev/fd0h1200 (1.2M drive a:)
  840. 4 - /dev/fd1h1200 (1.2M drive b:)
  841. EOF
  842.    while [ 0 ]; do
  843.     echo
  844.     echo -n "Which drive would you like to install from (1/2/3/4)? "
  845.     read WHICH_DRIVE;
  846.     echo
  847.     if [ "$WHICH_DRIVE" = "1" ]; then
  848.      SOURCE_DEVICE="/dev/fd0u1440"
  849.      break;
  850.     elif [ "$WHICH_DRIVE" = "2" ]; then
  851.      SOURCE_DEVICE="/dev/fd1u1440"
  852.      break;
  853.     elif [ "$WHICH_DRIVE" = "3" ]; then
  854.      SOURCE_DEVICE="/dev/fd0h1200"
  855.      break;
  856.     elif [ "$WHICH_DRIVE" = "4" ]; then
  857.      SOURCE_DEVICE="/dev/fd1h1200"
  858.      break;
  859.     fi
  860.    done 
  861.   elif [ "$SOURCE_MEDIA" = "3" ]; then
  862.    cat << EOF
  863.  
  864. NFS INSTALLATION
  865.  
  866. We need to know a few things before going on...
  867.  
  868. EOF
  869.    if [ "$T_PX" = "/" ]; then
  870.     echo "You're running off the hard drive filesystem. Is this machine"
  871.     echo "currently running on the network you plan to install from? If"
  872.     echo "so, we won't try to reconfigure your ethernet card."
  873.     echo 
  874.     echo -n "Are you up-and-running on the network ([y]es, [n]o)? "
  875.     read UPNRUN;
  876.     echo
  877.    fi
  878.    if [ ! "$UPNRUN" = "y" ]; then
  879.     cat << EOF
  880. You will need to enter the IP address you wish to
  881. assign to this machine. Example: 111.112.113.114
  882.  
  883. EOF
  884.     echo -n "What is your IP address? "
  885.     read LOCAL_IPADDR;
  886.     cat << EOF
  887.  
  888. Now we need to know your netmask.
  889. Typically this will be 255.255.255.0
  890.  
  891. EOF
  892.     echo -n "What is your netmask? "
  893.     read LOCAL_NETMASK;
  894. #    cat << EOF
  895. #
  896. #Typically your broadcast address will be the same as
  897. #your IP address with 255 replacing the final value.
  898. #Example: 111.112.113.255
  899. #
  900. #EOF
  901. #    echo -n "What is your broadcast address? "
  902. #    read LOCAL_BROADCAST;
  903. #    cat << EOF
  904. #
  905. #Now we need your network address.
  906. #
  907. #Your network address will usually be the same as your IP
  908. #address, with the last value replaced by 0.
  909. #For example: 111.112.113.0
  910. #
  911. #EOF
  912. #    echo -n "What is your network address? "
  913. #    read LOCAL_NETWORK;
  914. LOCAL_BROADCAST=`ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 1 -d ' '`
  915. LOCAL_NETWORK=`ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 2 -d ' '`
  916.     echo 
  917.     echo -n "Do you have a gateway (y/n)? "
  918.     read HAVE_GATEWAY;
  919.     echo 
  920.     if [ "$HAVE_GATEWAY" = "y" ]; then
  921.      echo 
  922.      echo -n "What is your gateway address? "
  923.      read LOCAL_GATEWAY;  
  924.     fi
  925.    fi # ! UPNRUN
  926.    cat << EOF
  927.  
  928. Good! We're all set on the local end, but now we need to know
  929. where to find the software packages to install. First, we need
  930. the IP address of the machine where the Slackware sources are
  931. stored.
  932.  
  933. EOF
  934.    if [ "$UPNRUN" = "y" ]; then
  935.     cat << EOF
  936. Since you're already running on the network, you should be able to use the
  937. hostname instead of an IP address if you wish.
  938.  
  939. EOF
  940.    fi
  941.    echo -n "What is the IP address of your NFS server? "
  942.    read REMOTE_IPADDR;
  943.    if [ ! "$UPNRUN" = "y" ]; then
  944.      ENET_DEVICE="eth0" 
  945.    fi # ! UPNRUN
  946.    cat << EOF
  947.  
  948. There must be a directory on the server with the Slackware sources for 
  949. each disk in subdirectories beneath it.
  950.  
  951. The installation script needs to know the name of the directory
  952. on your server that contains the disk subdirectories. For example,
  953. if your A3 disk is found at /slackware/a3, then you would
  954. respond: /slackware
  955.  
  956. EOF
  957.    echo -n "What is the Slackware source directory? "
  958.    read REMOTE_PATH;
  959.    echo 
  960.    if [ ! "$UPNRUN" = "y" ]; then
  961.     echo "Configuring ethernet card..."
  962.     ifconfig $ENET_DEVICE $LOCAL_IPADDR netmask $LOCAL_NETMASK broadcast $LOCAL_BROADCAST
  963.     # Older kernel versions need these to set up the eth0 routing table.
  964.     KVERSION=`uname -r | cut -f 1,2 -d .`
  965.     if [ "$KVERSION" = "1.0" -o "$KVERSION" = "1.1" \
  966.       -o "$KVERSION" = "1.2" -o "$KVERSION" = "2.0" -o "$KVERSION" = "" ]; then
  967.       /sbin/route add -net ${LOCAL_NETWORK} netmask ${LOCAL_NETMASK} eth0
  968.     fi
  969.     if [ "$HAVE_GATEWAY" = "y" ]; then
  970.      echo "Configuring your gateway..."
  971.      route add default gw $LOCAL_GATEWAY metric 1
  972.     fi
  973.    fi
  974.    echo "Mounting NFS..."
  975.    mount -t nfs $REMOTE_IPADDR:$REMOTE_PATH /var/adm/mount
  976.    SOURCE_MOUNTED="-source_mounted"
  977.    DISTRIBUTION_SOURCE="/var/adm/mount"
  978.    echo
  979.   elif [ "$SOURCE_MEDIA" = "5" ]; then
  980.    cat << EOF
  981. INSTALLING FROM SLACKWARE CD-ROM
  982.  
  983. What type of CD-ROM drive do you have?
  984.  
  985. 1  -- Works with most ATAPI/IDE CD drives (/dev/hd*)
  986. 2  -- SCSI (/dev/scd0 or /dev/scd1)
  987. 3  -- Sony CDU31A/CDU33A (/dev/sonycd)
  988. 4  -- Sony 531/535 (/dev/cdu535)
  989. 5  -- Mitsumi (proprietary interface, not IDE) (/dev/mcd)
  990. 6  -- New Mitsumi (also not IDE) (/dev/mcdx0)
  991. 7  -- Sound Blaster Pro/Panasonic (/dev/sbpcd)
  992. 8  -- Aztech/Orchid/Okano/Wearnes (/dev/aztcd)
  993. 9  -- Phillips and some ProAudioSpectrum16 (/dev/cm206cd)
  994. 10 -- Goldstar R420 (/dev/gscd)
  995. 11 -- Optics Storage 8000 (/dev/optcd)
  996. 12 -- Sanyo CDR-H94 + ISP16 soundcard (/dev/sjcd)
  997. 13 -- Try to scan for your CD drive
  998.  
  999. EOF
  1000.    while [ 0 ]; do
  1001.     echo -n "CD-ROM type (1/2/3/4/5/6/7/8)? "
  1002.     read CD_ROM_TYPE;
  1003.     echo
  1004.     if [ "$CD_ROM_TYPE" = "1" ]; then
  1005.      echo "SELECT IDE DEVICE"
  1006.      echo
  1007.      echo "Enter the device name that represents your IDE CD-ROM drive."
  1008.      echo "This will probably be one of these (in the order of most to least"
  1009.      echo "likely):  /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg "
  1010.      echo "/dev/hdh /dev/hda"
  1011.      echo
  1012.      echo -n "Enter device name: "
  1013.      read CD_DEVICE;
  1014.      echo
  1015.      break;
  1016.     elif [ "$CD_ROM_TYPE" = "2" ]; then
  1017.      cat << EOF
  1018. Which SCSI CD-ROM are you using? If you're not sure, select scd0.
  1019.  
  1020. 1 -- /dev/scd0
  1021. 2 -- /dev/scd1
  1022.  
  1023. EOF
  1024.      echo -n "Which SCSI CD-ROM (1/2)? "
  1025.      read WHICH_SCSI_CD;
  1026.      echo
  1027.      if [ "$WHICH_SCSI_CD" = "1" ]; then
  1028.       CD_DEVICE="/dev/scd0"
  1029.       break;
  1030.      else
  1031.       CD_DEVICE="/dev/scd1"
  1032.       break;
  1033.      fi
  1034.     elif [ "$CD_ROM_TYPE" = "3" ]; then
  1035.      CD_DEVICE="/dev/sonycd"
  1036.      break;
  1037.     elif [ "$CD_ROM_TYPE" = "4" ]; then
  1038.      CD_DEVICE="/dev/cdu535"
  1039.      break;
  1040.     elif [ "$CD_ROM_TYPE" = "5" ]; then
  1041.      CD_DEVICE="/dev/mcd"
  1042.      break;
  1043.     elif [ "$CD_ROM_TYPE" = "6" ]; then
  1044.      CD_DEVICE="/dev/mcdx0"
  1045.      break;
  1046.     elif [ "$CD_ROM_TYPE" = "7" ]; then
  1047.      CD_DEVICE="/dev/sbpcd"
  1048.      break;
  1049.     elif [ "$CD_ROM_TYPE" = "8" ]; then
  1050.      CD_DEVICE="/dev/aztcd"
  1051.      break;
  1052.     elif [ "$CD_ROM_TYPE" = "9" ]; then
  1053.      CD_DEVICE="/dev/cm206cd"
  1054.      break;
  1055.     elif [ "$CD_ROM_TYPE" = "10" ]; then
  1056.      CD_DEVICE="/dev/gscd"
  1057.      break;
  1058.     elif [ "$CD_ROM_TYPE" = "11" ]; then
  1059.      CD_DEVICE="/dev/optcd"
  1060.      break;
  1061.     elif [ "$CD_ROM_TYPE" = "12" ]; then
  1062.      CD_DEVICE="/dev/sjcd"
  1063.      break;
  1064.     elif [ "CD_ROM_TYPE" = "13" ]; then
  1065.       for device in /dev/scd0 /dev/scd1 /dev/sonycd /dev/cdu535 /dev/mcd \
  1066.       /dev/sbpcd /dev/aztcd /dev/hdd /dev/hdc /dev/hdb /dev/hda \
  1067.       /dev/hde /dev/hdf /dev/hdg /dev/hdh \
  1068.       /dev/cm206cd /dev/gscd0 /dev/mcdx0 /dev/mcdx1 \
  1069.       /dev/optcd0 /dev/sjcd ; do
  1070.         mount -o ro -t iso9660 $device /var/adm/mount 1> /dev/null 2> /dev/null
  1071.         if [ $? = 0 ]; then
  1072.           DRIVE_FOUND=$device
  1073.           break
  1074.         fi
  1075.       done
  1076.       if [ "$DRIVE_FOUND" = "" ]; then
  1077.         cat << EOF
  1078.  
  1079. A CD-ROM drive could not be found on any of the devices that were scanned.
  1080. Make sure you're using the bootdisk that contains the drivers that support
  1081. your CD drive. Please consult the BOOTING file for more information on forcing
  1082. the detection of your drive, and then reattempt installation.  If all else 
  1083. fails, see the SLAKWARE.FAQ for information about copying parts of this CD 
  1084. to your DOS partition to allow you to install.
  1085.  
  1086. EOF
  1087.       else
  1088.         echo
  1089.         echo "Drive detected on device $DRIVE_FOUND."
  1090.         CD_DEVICE="$DRIVE_FOUND"
  1091.       fi
  1092.       break
  1093.     fi
  1094.    done
  1095.    # Write out the /etc/fstab line:
  1096. #   echo "$CD_DEVICE    /cdrom    iso9660    ro   1   1" > $TMP/SeTcdfstab
  1097.    cat << EOF
  1098. CHOOSE YOUR INSTALLATION METHOD
  1099.  
  1100. With Slackware, you can run most of the system from the CD-ROM if you're
  1101. short of drive space or if you just want to test Linux without going 
  1102. through a complete installation.
  1103.  
  1104. slakware   Normal installation to hard drive
  1105. slaktest   Link /usr->/cdrom/live/usr to run mostly from CD-ROM
  1106.  
  1107. EOF
  1108.    echo -n "Which type of installation do you want (slakware or slaktest)? "
  1109.    read SLACK_SOURCE_LOCATION;
  1110.    echo
  1111.    if [ -r $TMP/CDdebug ]; then # we here @ Slackware labs are debuggin' a CD.
  1112.     echo "Source location: $SLACK_SOURCE_LOCATION"
  1113.     echo "Mount command would be:"
  1114.     echo "mount -o ro -t iso9660 $CD_DEVICE /var/adm/mount"
  1115.     echo "This line put in $TMP/SeTcdfstab:"
  1116.     echo "$CD_DEVICE    /cdrom    iso9660    ro"
  1117.     echo
  1118.     echo "Fix it up, Tex, and then type 'exit' to snap back to reality."
  1119.     echo
  1120.     /bin/sh
  1121.    else
  1122.     while [ 0 ]; do
  1123.      mount -o ro -t iso9660 $CD_DEVICE /var/adm/mount
  1124.      if [ ! $? = 0 ]; then
  1125.       cat << EOF
  1126.  
  1127. There was an error attempting to mount the CD-ROM device. Would you like to:
  1128.  
  1129. 1 -- Abort the installation
  1130. 2 -- Attempt to mount the CD-ROM device again
  1131. 3 -- Ignore the error and continue.
  1132.  
  1133. EOF
  1134.       echo -n "Which (1/2/3)? "     
  1135.       read DOWHAT;
  1136.       echo
  1137.       if [ $DOWHAT = 1 ]; then
  1138.        exit;
  1139.       elif [ $DOWHAT = 3 ]; then
  1140.        break;
  1141.       fi
  1142.      else
  1143.       break;
  1144.      fi
  1145.     done
  1146.    fi # debug ?
  1147.    # since we've mounted successfully, let's refresh the link:
  1148.    if [ ! -d $T_PX/dev ]; then
  1149.     mkdir $T_PX/dev
  1150.     chown root.root $T_PX/dev
  1151.     chmod 755 $T_PX/dev
  1152.    fi
  1153.    ( cd $T_PX/dev ; ln -sf $CD_DEVICE cdrom )
  1154.    DISTRIBUTION_SOURCE=/var/adm/mount/$SLACK_SOURCE_LOCATION
  1155.    SOURCE_MOUNTED="-source_mounted"
  1156.   fi # remote sources are now mounted, if they needed to be
  1157.   cat << EOF
  1158.  
  1159. SERIES SELECTION:
  1160. These disk sets (and possibly more) are available:
  1161. EOF
  1162.   print_list;
  1163.   cat << EOF
  1164. You may specify any combination of disk sets at the prompt which follows. For 
  1165. example - to install the base system, the base X window system, and the Tcl 
  1166. toolkit, you would enter: a x tcl  (if you're running from CD-ROM, use a and q!) 
  1167. EOF
  1168.   echo -n "Which disk sets do you want to install? "
  1169.   read INSTSETS;
  1170.   INSTT="`echo "$INSTSETS" | sed 's/ /#/g'`"
  1171.   INSTT="`echo "$INSTT" | sed 's/,/#/g'`"
  1172.   INSTT="`echo "$INSTT" | sed 's/;/#/g'`"
  1173.   SERIES="-sets #`echo $INSTT`#"
  1174.   cat << EOF
  1175.  
  1176. SOFTWARE INSTALLATION
  1177.  
  1178. Next, software packages are going to be transfered on to your hard drive.
  1179. If this is your first time installing Linux, you should probably use
  1180. PROMPT mode. This will follow a defaults file on the first disk of each
  1181. series you install that will ensure that required packages are installed
  1182. automatically. You will be prompted for the installation of other packages.
  1183.  
  1184. These defaults are user definable -- you may set any package to be added
  1185. or skipped automatically by editing your choices into a file called TAGFILE
  1186. that will be found on the first disk of each series. There will also be a
  1187. copy of the original tagfile called TAGFILE.ORG available in case you want
  1188. to restore the default settings. The tagfile contains all the instructions
  1189. needed to completely automate your installation.
  1190.  
  1191. NOTE: Software may be added to your system after the initial installation.
  1192. A copy of setup will be placed in your /sbin directory. Just type 'setup' to
  1193. add software to your system. Another script, PKGTOOL, may be used to add
  1194. software packages from the current directory, or to cleanly remove packages
  1195. that you want uninstalled.
  1196.  
  1197. If you don't use PROMPT mode, the install program will just go ahead and
  1198. install everything from the disk sets you have selected.
  1199.  
  1200. EOF
  1201.   echo -n "Do you want to use PROMPT mode (y/n)? "
  1202.   read REPLY;
  1203.   echo 
  1204.   if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
  1205.    IGNORE_TAGFILES=""
  1206.    cat << EOF
  1207. PROMPT mode selected.
  1208.  
  1209. Using prompting defaults found in tagfiles along the way.
  1210.  
  1211. EOF
  1212.    echo "Would you like to use a special tagfile extension?"
  1213.    echo
  1214.    echo "You can specify an extension consisting of a '.' followed by any "
  1215.    echo "combination of 3 characters other than 'tgz'. For instance, I specify"
  1216.    echo "'.pat', and then whenever any tagfiles called 'tagfile.pat' are found"
  1217.    echo "during the installation they are used instead of the default 'tagfile'"
  1218.    echo "files. If the install program does not find tagfiles with the custom"
  1219.    echo "extension, it will use the default tagfiles."
  1220.    echo
  1221.    echo "Enter your custom tagfile extension (including the leading '.'), or just"
  1222.    echo -n "press ENTER to continue without a custom extension. ==>"
  1223.    read CUSTOM_EXT;
  1224.    echo "$CUSTOM_EXT" > $TMP/custom
  1225.   else
  1226.    IGNORE_TAGFILES="-ignore_tagfiles"
  1227.    cat << EOF
  1228. PROMPT mode not selected.
  1229.  
  1230. Installing all the packages on the selected disk sets.
  1231. EOF
  1232.   fi
  1233.   if [ "$DISTRIBUTION_SOURCE" != "" ]; then
  1234.    pkgtool.tty $SOURCE_MOUNTED $IGNORE_TAGFILES -source_device $SOURCE_DEVICE -source_dir $DISTRIBUTION_SOURCE -target_dir $T_PX $SERIES
  1235.   else
  1236.    pkgtool.tty $SOURCE_MOUNTED $IGNORE_TAGFILES -source_device $SOURCE_DEVICE -target_dir $T_PX $SERIES
  1237.   fi
  1238.   if [ ! "$ADDSOFT" = "a" ]; then 
  1239.    if [ -r $TMP/SeTcdfstab ]; then
  1240.     cat $TMP/SeTcdfstab >> $T_PX/fstab
  1241.     mkdir -p $T_PX/cdrom
  1242.    fi
  1243.    echo "none        /proc        proc        defaults   1   1" >> $T_PX/fstab
  1244.    echo " " >> $T_PX/fstab
  1245.   fi
  1246.  fi # adding software from / ?
  1247.  # Make 'ROOTDEV' file so /etc/rc.d/rc.S knows which partition to remount
  1248.  # Note - this isn't used anymore, but I guess it doesn't hurt to keep it.
  1249. # if [ ! -r $T_PX/etc/rc.d/ROOTDEV ]; then
  1250. #  echo "$ROOT_DEVICE" > $T_PX/etc/rc.d/ROOTDEV
  1251. #  chmod 644 $T_PX/etc/rc.d/ROOTDEV
  1252. # fi
  1253.  if [ "$T_PX" = "/" -o "$ADDSOFT" = "a" ]; then
  1254.   cat << EOF
  1255.  
  1256. EXTRA CONFIGURATION
  1257.  
  1258. If you wish, you may now go through the options to reconfigure your
  1259. hardware, make a bootdisk, and install LILO.
  1260.  
  1261. If you've installed a new kernel image, you should go through these
  1262. steps again. Otherwise, it's up to you.
  1263.  
  1264. EOF
  1265.   echo -n "Reconfigure ([y]es, [n]o)? "
  1266.   read RECON;
  1267.   echo
  1268.   if [ "$RECON" = "y" ]; then
  1269.    ADDSOFT="n"
  1270.   else
  1271.    ADDSOFT="a"
  1272.   fi
  1273.  fi
  1274.  if [ ! "$ADDSOFT" = "a" ]; then
  1275.   if [ ! -r $T_PX/etc/fstab ]; then
  1276.    mv $T_PX/fstab $T_PX/etc/fstab
  1277.    chmod 644 $T_PX/etc/fstab
  1278.   fi
  1279.   echo
  1280.   echo "It is recommended that you make a boot disk."
  1281.   echo -n "Would you like to do this ([y]es, [n]o)? "
  1282.   read MAKE_BOOT;
  1283.   if [ "$MAKE_BOOT" = "y" ]; then # we can make a boot disk since the boot drive is free
  1284.    cat << EOF
  1285.  
  1286. BOOT DISK CREATION
  1287.  
  1288. Now put a formatted floppy in your boot drive.
  1289. This will be made into your Linux boot disk. Use this to
  1290. boot Linux until LILO has been configured to boot from
  1291. the hard drive.
  1292.  
  1293. Any data on the target disk will be destroyed.
  1294. EOF
  1295.    echo -n "Insert the disk and press [return], or [s] if you want to skip this step: "
  1296.    read REPLY;
  1297.    echo
  1298.    if [ ! "$REPLY" = "s" ]; then
  1299.     echo "Creating boot disk..."
  1300.     if [ -r $T_PX/vmlinuz ]; then
  1301.      KERNEL='/vmlinuz'
  1302.     else
  1303.      KERNEL='/zImage'
  1304.     fi
  1305.     echo "  - writing kernel to disk: (dd if=$T_PX$KERNEL of=/dev/fd0)"
  1306.     dd if=$T_PX$KERNEL of=/dev/fd0
  1307.     echo "Configuring boot disk..."
  1308.     echo -n "  - boot device: "
  1309.     rdev /dev/fd0 $ROOT_DEVICE
  1310.     echo "(rdev /dev/fd0 $ROOT_DEVICE)"
  1311.     echo -n "  - video mode: "
  1312.     rdev -v /dev/fd0 -1
  1313.     echo "(rdev -v /dev/fd0 -1)"
  1314.     echo -n "  - mount root read-only: "
  1315.     echo "(rdev -R /dev/fd0 1)"
  1316.     rdev -R /dev/fd0 1
  1317.     sync
  1318.     echo "Boot disk created."
  1319.    else
  1320.     echo "Boot disk creation skipped."
  1321.     echo "You better install LILO, or you'll have a hard time booting."
  1322.    fi
  1323.    echo 
  1324.   fi
  1325.   echo
  1326.   echo "MODEM/MOUSE CONFIGURATION"
  1327.   while [ 0 ]; do
  1328.    cat << EOF
  1329.  
  1330. Modem Setup:
  1331.  
  1332. A link in /dev will be created from your serial device (ttyS0, ttyS1,
  1333. ttyS2, ttyS3) to /dev/modem. You can change this link later if you put
  1334. your modem on a different port.
  1335.  
  1336. EOF
  1337.    echo -n "Would you like to set up your modem ([y]es, [n]o)? "
  1338.    read REPLY;
  1339.    if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
  1340.     cat << EOF
  1341.  
  1342. These are the standard serial I/O devices:
  1343.  
  1344. 0 -- /dev/ttyS0 (or com1: under DOS)
  1345. 1 -- /dev/ttyS1 (or com2: under DOS)
  1346. 2 -- /dev/ttyS2 (or com3: under DOS)
  1347. 3 -- /dev/ttyS3 (or com4: under DOS)
  1348.  
  1349. EOF
  1350.     echo -n "Which device is your modem attached to (0, 1, 2, 3)? "
  1351.     read MODEM_DEVICE;
  1352.     if [ "$MODEM_DEVICE" = "0" ]; then
  1353.      (cd $T_PX/dev; ln -sf ttyS0 modem)
  1354.      break;
  1355.     elif [ "$MODEM_DEVICE" = "1" ]; then
  1356.      (cd $T_PX/dev; ln -sf ttyS1 modem)
  1357.      break;
  1358.     elif [ "$MODEM_DEVICE" = "2" ]; then
  1359.      (cd $T_PX/dev; ln -sf ttyS2 modem)
  1360.      break;
  1361.     elif [ "$MODEM_DEVICE" = "3" ]; then
  1362.      (cd $T_PX/dev; ln -sf ttyS3 modem)
  1363.      break;
  1364.     else
  1365.      echo "Not a valid device. Please hit [enter] to try again, or [q]"
  1366.      echo -n "to skip modem configuration."
  1367.      read REPLY;
  1368.      if [ "$REPLY" = "q" ]; then
  1369.       break;
  1370.      fi
  1371.      echo
  1372.     fi
  1373.    else
  1374.     break;
  1375.    fi
  1376.   done
  1377.   while [ 0 ]; do
  1378.    cat << EOF
  1379.  
  1380. Mouse Setup:
  1381.  
  1382. A link will be created in /dev from your mouse device to /dev/mouse.
  1383. You can change this link later if you switch to a different type of
  1384. mouse.
  1385.  
  1386. EOF
  1387.    MTYPE="none"
  1388.    echo -n "Would you like to set up your mouse ([y]es, [n]o)? "
  1389.    read REPLY;
  1390.    if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
  1391.     cat << EOF
  1392.  
  1393. These types are supported:
  1394.  
  1395. 1 -- Microsoft compatible serial mouse.
  1396. 2 -- QuickPort or PS/2 style mouse. (Auxiliary port).
  1397. 3 -- Logitech Bus Mouse
  1398. 4 -- ATI XL Bus Mouse
  1399. 5 -- Microsoft Bus Mouse
  1400. 6 -- Mouse Systems serial mouse
  1401. 7 -- Logitech (MouseMan) serial mouse
  1402.  
  1403. EOF
  1404.     echo -n "Which type of mouse do you have (1, 2, 3, 4, 5, 6, 7) ? "
  1405.     read MOUSE_TYPE;
  1406.     if [ "$MOUSE_TYPE" = "1" -o "$MOUSE_TYPE" = "6" -o "$MOUSE_TYPE" = "7" ]; then
  1407.      cat << EOF
  1408.  
  1409. These are the standard serial I/O devices:
  1410.  
  1411. 0 -- /dev/ttyS0 (or com1: under DOS)
  1412. 1 -- /dev/ttyS1 (or com2: under DOS)
  1413. 2 -- /dev/ttyS2 (or com3: under DOS)
  1414. 3 -- /dev/ttyS3 (or com4: under DOS)
  1415.  
  1416. EOF
  1417.      echo -n "Which device is your mouse attached to (0, 1, 2, 3)? "
  1418.      read MOUSE_DEVICE;
  1419.      if [ "$MOUSE_TYPE" = "1" ]; then
  1420.       MTYPE="ms"
  1421.      elif [ "$MOUSE_TYPE" = "7" ]; then
  1422.       MTYPE="mman"
  1423.      else
  1424.       MTYPE="msc"
  1425.      fi
  1426.      if [ "$MOUSE_DEVICE" = "0" ]; then
  1427.       (cd $T_PX/dev; ln -sf ttyS0 mouse)
  1428.       break;
  1429.      elif [ "$MOUSE_DEVICE" = "1" ]; then
  1430.       (cd $T_PX/dev; ln -sf ttyS1 mouse)
  1431.       break;
  1432.      elif [ "$MOUSE_DEVICE" = "2" ]; then
  1433.       (cd $T_PX/dev; ln -sf ttyS2 mouse)
  1434.       break;
  1435.      elif [ "$MOUSE_DEVICE" = "3" ]; then
  1436.       (cd $T_PX/dev; ln -sf ttyS3 mouse)
  1437.       break;
  1438.      fi
  1439.     elif [ "$MOUSE_TYPE" = "2" ]; then
  1440.      (cd $T_PX/dev; ln -sf psaux mouse)
  1441.      MTYPE="ps2"
  1442.      break;
  1443.     elif [ "$MOUSE_TYPE" = "3" ]; then
  1444.      (cd $T_PX/dev; ln -sf logibm mouse)
  1445.      MTYPE="logi"
  1446.      break;
  1447.     elif [ "$MOUSE_TYPE" = "4" ]; then
  1448.      (cd $T_PX/dev; ln -sf atibm mouse)
  1449.      MTYPE="bm"
  1450.      break;
  1451.     elif [ "$MOUSE_TYPE" = "5" ]; then
  1452.      (cd $T_PX/dev; ln -sf inportbm mouse)
  1453.      MTYPE="bm"
  1454.      break;
  1455.     else
  1456.      echo "Incorrect mouse selection. Please try again."
  1457.     fi
  1458.     echo
  1459.    else
  1460.     break;
  1461.    fi
  1462.   done
  1463.   export MTYPE
  1464.   ( cd $T_PX ; chmod 755 ./ )
  1465.   ( cd $T_PX ; chmod 755 ./var )
  1466.   if [ ! -d $T_PX/proc ]; then
  1467.    mkdir $T_PX/proc
  1468.    chown root.root $T_PX/proc
  1469.   fi
  1470.   if [ ! -d $T_PX/var/spool/uucp ]; then
  1471.    mkdir -p $T_PX/var/spool/uucp
  1472.    chmod 1777 $T_PX/var/spool/uucp
  1473.   fi
  1474.   if [ ! -d $T_PX/var/spool/mail ]; then
  1475.    mkdir -p $T_PX/var/spool/mail
  1476.    chmod 755 $T_PX/var/spool
  1477.    chown root.mail $T_PX/var/spool/mail
  1478.    chmod 775 $T_PX/var/spool/mail
  1479.   fi 
  1480.  
  1481.   # Post installation and setup scripts added by packages.
  1482.   if [ -d $T_PX/var/log/setup ]; then
  1483.    if [ "$T_PX" = "/" ]; then
  1484.     ROOT_DEVICE=`mount | fgrep "on / " | cut -f 1 -d ' '`
  1485.    fi
  1486.    for INSTALL_SCRIPTS in $T_PX/var/log/setup/setup.*
  1487.    do
  1488.     SCRIPT=`basename $INSTALL_SCRIPTS`
  1489.     # Here, we call each script in /var/log/setup. Two arguments are provided:
  1490.     # 1 -- the target prefix (normally /, but /mnt from the bootdisk)
  1491.     # 2 -- the name of the root device.
  1492.     ( cd $T_PX ; sh var/log/setup/$SCRIPT $T_PX $ROOT_DEVICE )
  1493.     if echo $SCRIPT | fgrep onlyonce 1> /dev/null 2> /dev/null; then # only run after first install
  1494.      if [ ! -d $T_PX/var/log/setup/install ]; then
  1495.       mkdir $T_PX/var/log/setup/install
  1496.      fi
  1497.      mv $INSTALL_SCRIPTS $T_PX/var/log/setup/install
  1498.     fi
  1499.    done
  1500.   fi
  1501.  
  1502.  fi # ! just adding stuff
  1503.  rm -f $T_PX/tagfile
  1504.  if [ "$REMAPPING_DONE" = "true" ]; then
  1505.   echo "#!/bin/sh" > $T_PX/etc/rc.d/rc.keymap
  1506.   echo "/usr/bin/loadgzkeys $MAPNAME" >> $T_PX/etc/rc.d/rc.keymap
  1507.   chmod 755 $T_PX/etc/rc.d/rc.keymap
  1508.  fi 
  1509.  sync
  1510.  if [ "$T_PX" = "/" ]; then
  1511.   echo "Installation of additional software is now complete."
  1512.  else
  1513.   echo "Linux installation is complete. "
  1514.  fi
  1515.  if [ "$T_PX" = "/mnt" ]; then
  1516.   echo 
  1517.   echo "You may now reboot your computer by pressing control+alt+delete."
  1518.   echo 
  1519.  fi
  1520.  if [ "$T_PX" = "/mnt" ]; then
  1521.   echo "If you installed LILO, remove the boot disk from your computer "
  1522.   echo "before rebooting. "
  1523.  fi
  1524.  if [ "y" = "$T_MT" ]; then
  1525.   if [ ! "$ADDSOFT" = "a" ]; then
  1526.    echo
  1527.    echo "Don't forget to create your /etc/fstab if you don't have one!"
  1528.    echo "(vi $T_PX/etc/fstab)"
  1529.    echo
  1530.   fi
  1531.  fi
  1532.  echo 
  1533. else
  1534.  cat << EOF
  1535. You have not yet designated any disk partitions as Linux native.
  1536.  
  1537. If you are planning to use OS/2 Boot Manager, make your Linux
  1538. partitions with OS/2 fdisk, reboot this disk, and then use Linux
  1539. fdisk to tag the partitions as type 83 (Linux native).
  1540.  
  1541. Linux fdisk will select a default device when called without
  1542. arguments, and from there it is menu driven. If you don't want
  1543. to partition the default device, then call fdisk with the device
  1544. you want as the argument, like this:
  1545.  
  1546. fdisk /dev/hdb
  1547.  
  1548. If you are not using the OS/2 Boot Manager, then you may use Linux
  1549. fdisk to create partitions for Linux. Other than the exception for
  1550. the OS/2 Boot Manager, you are usually better off creating partitions
  1551. for a given OS using a partitioning tool native to that OS. In other
  1552. words, you probably shouldn't try to make your DOS or other non-Linux
  1553. partitions with the Linux fdisk.
  1554.  
  1555. Please make one or more partitions for Linux, and try setup again.
  1556. If you haven't already, you might want to also make a swap partition
  1557. while you're in fdisk. 8 megabytes would be a good starting size for
  1558. a single user system. Linux swap is tagged as type 82.
  1559. EOF
  1560.  exit;
  1561. fi
  1562. if mount | fgrep /var/adm/mount 1> /dev/null 2> /dev/null ; then
  1563.  umount /var/adm/mount 
  1564. fi
  1565. rm -f /var/adm/mount 2> /dev/null
  1566. rmdir /var/adm/mount 2> /dev/null
  1567. mkdir /var/adm/mount 2> /dev/null
  1568. chmod 755 /var/adm/mount
  1569. if [ -r /tagfile ]; then
  1570.  rm -f /tagfile
  1571. fi
  1572. chmod 755 $T_PX
  1573. chmod 1777 $T_PX/tmp
  1574. rm -f $TMP/custom
  1575. # end slackware setup script
  1576.